<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Text Layout Framework: ActionScript Examples</title>
</head>

<body>
<h1>Text Layout Framework: ActionScript Examples</h1>
<p>The Text Layout Framework is an ActionScript library that provides text layout functionality. It is built on the Flash text engine available in Flash Player 10. This framework provides  support for high quality, typographically rich, flowable text layout  with selection, editing, undo, copy-paste, and an XML markup language to dynamically style text. </p>
<p>The Text Layout Framework can be used by any developer who wants to build new text components for Flash Player, Flash CS4, or Flex(R). It uses pure  ActionScript; you can work with it in any Flash Professional or Flex development environment. The library is implemented by the <font face="Courier New, Courier, monospace">flashx.textLayout.*</font> packages in <font face="Courier New, Courier, monospace">textLayout.swc</font>.</p>
<h2>ActionScript examples</h2>
<p>These examples in the <font face="Courier New, Courier, monospace">actionscript</font> folder of the Text Layout Framework SDK demonstrate techniques for working with the  API in ActionScript. </p>
<h3>Basic TextFlow</h3>
<table width="810" border="1">
  <tr>
    <td width="334"><font face="Courier New, Courier, monospace">TextLayout/HelloWorld.as</font></td>
    <td width="460">Demonstrates creating and displaying a TextFlow</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/StaticHelloWorld.as</font></td>
    <td>Demonstrates use of a TextLineFactory with a string to create static TextLines.</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/InlineGraphic.as</font></td>
    <td>Extends the HelloWorld example with an inline graphic loaded from a remote web site.</td>
  </tr>
  </table>
  <h3>Importer</h3>
  <table width="810" border="1">
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/ImportMarkup.as</font></td>
    <td>Demonstrates parsing and displaying TextLayout markup.</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/StaticTextFlow.as</font></td>
    <td>Demonstrates use of a TextLineFactory  with parsing of TextLayout markup to create static TextLines.</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/CustomImportMarkup.as</font></td>
    <td>Customizes the Configuration used by the importer to create a TextFlow that manages the Tab key and has a customized default format for links.</td>
  </tr>
   </table>
  <h3>Selection and editing </h3>
<table width="810" border="1">
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/EditText.as</font></td>
    <td>Demonstrates parsing TextLayout markup, displaying it and attaching an EditManager so that it can be edited.</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/SelectText.as</font></td>
    <td>Demonstrates parsing TextLayout markup, displaying it, and attaching a SelectionManager so that it can be selected and copied.</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/ExplicitFormField.as</font></td>
    <td>Demonstrates editable form style fields that scroll and do not break except on explicit breaks.</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/MultipleColumns.as</font></td>
    <td>Demonstrates editable multi-column text where the columns resize and adjust number as the window resizes.</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/MultipleContainerColumns.as</font></td>
    <td>Demonstrates editable multi-column text flowing through two containers where the columns resize and adjust number as the window resizes.</td>
  </tr>
</table>
<h3>Additional features</h3>
<table width="810" border="1">
  <tr>
  	<td><font face="Courier New, Courier, monospace">TextLayout/ParagraphBounds.as</font></td>
    <td><p>Demonstrates computing the height of a paragraph.</p>    </td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/ParagraphBorder.as</font></td>
    <td>Demonstrates drawing a border and background on a paragraph.</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/LinkedContainers.as</font></td>
    <td>Demonstrates linked containers.</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">TextLayout/CustomEventHandler.as</font></td>
    <td>Demonstrates how to handle custom user-interaction events in LinkElements.</td>
  </tr>
</table>
<h3>Flash Text Engine (FTE) examples</h3>
<table width="810" border="1">  
  <tr>
    <td><font face="Courier New, Courier, monospace">FTE/FTEHelloWorld.as</font></td>
    <td>Implements the HelloWorld example using direct FTE APIs</td>
  </tr>
  <tr>
    <td><font face="Courier New, Courier, monospace">FTE/FTEParagraph.as</font></td>
    <td>Demonstrates a  paragraph of text, defined with direct FTE APIs, that reflows on window resize.</td>
  </tr>
</table>
<h2>Building the examples</h2>
<p>You can build these examples with Flex 3.2, Flex Gumbo, or Adobe CS4 Flash Professional.</p>
<h3>Building in a Flex environment</h3>
<p>These steps are for loading the examples into your Flex development environment from the Text Layout Framework ZIP</p>
<ol>
  <li>Open Flex Builder or Eclipse with the Flex Builder plug-in.</li>
  <li>Switch your workspace to the parent of the Examples folder</li>
  <li>In the Preferences dialog Flex tab, select &quot;Installed Flex SDKs&quot;.</li>
  <li>Add the Flex 3.2 or Flex Gumbo version of the SDK, and make it the default SDK.</li>
  <li>Choose File &gt; Import.</li>
  <li> In the General tab, select &quot;Existing Projects into Workspace&quot;.</li>
  <li>Browse to  the root folder of the workspace. It is preselected.</li>
  <li>Deselect any examples you do not want to import. Do not select &quot;Copy into workspace&quot;.</li>
  <li>Click OK. You can now build and run the examples from your development environment.</li>
</ol>
<h3>Building in Adobe CS4 Flash Professional</h3>
<p> To build the examples using Adobe CS4 Flash Professional:</p>
<ol>
  <li>Browse to the  folder containing the example you want to build.</li>
  <li>Create a new ActionScript 3.0 Flash File and save it into this folder.</li>
  <li>In the Properties panel, enter the example name (such as HelloWorld) in the Class field.</li>
  <li>Click Profile: Edit to open the Publish Settings dialog.</li>
  <li>Make sure that Player is set to Flash Player 10, and Script is set to ActionScript 3.0. </li>
  <li>For the <b>FTE</b> examples, you are done; click OK to dismiss the dialog. You can now publish the SWF for the example you have loaded.<br/><br/>  For the <b>TextLayout</b> examples, continue on</li>
  <li>Click Settings to open the Advanced ActionScript 3.0 Settings dialog. </li>
  <li>In the Library Path panel, add the folder containing the library files <font face="Courier New, Courier, monospace">textLayout.swc</font>. (These files are from the Text Layout Framework ZIP.)</li>
  <li>Click OK to dismiss the ActionScript Settings dialog,</li>
  <li>Click OK to dismiss the Publish Settings dialog. You can now publish the SWF for the example you have loaded.</li>
</ol>

<hr />
<p> <font size="1" face="Arial, Helvetica, sans-serif">ADOBE SYSTEMS INCORPORATED<br />
Copyright 2008 Adobe Systems Incorporated<br />
All Rights Reserved.<br />
<br />
NOTICE:  Adobe permits you to use, modify, and distribute this file 
in accordance with the terms of the Adobe license agreement 
accompanying it.  If you have received this file from a source 
other than Adobe, then your use, modification, or distribution 
of it requires the prior written permission of Adobe.</font></p>
<p><img src="Logo.jpg" alt="Adobe logo" width="46" height="52" /></p>
</body>
</html>
